var ns, app;
app = new Vue({
    el: '#app',
    data:{
        AppointTime:'',
        form:{
            ID:'',
            Name:'',
            PhoneNumber:'',
            WorkTime:'',
            Desc:'',
            ImagePath:'',
            QRCodeImgPath:''
        },
        UserName:''

    },
    methods:{
        get_data: function() {
            var that = this;
            var options = {};           
            options.action = "getbuildingmemberdetail";
            ns.post(options, function(succeed, data, err) {
                if (succeed) {                   
                    that.form = data.data;
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }, {
                toast: true
            });
        },
        open_edit: function(id) {
            var that=this;
            ns.openWin('guanjiaCar_edit', '管家名片',{
                id : that.form.ID
            });
            
        },
       
    },

});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    setTimeout(function() {
        app.UserName=api.getPrefs({
            sync:true,
            key:'loginname'        
        });
        app.get_data();
    }, 500)
    api.addEventListener({
        name: 'do_open_edit'
    }, function(ret, err) {
        app.open_edit(ret.value);
    });
    api.setRefreshHeaderInfo({
        bgColor: '#fff',
　　　　　textColor: '#4d4d4d',
    },function(ret, err){
　　　　　//下拉刷新时，刷新的数据　
        app.get_data();
　　　　　//刷新完数据后,将下拉刷新的事件关闭
        api.refreshHeaderLoadDone();
    });

};